/*

Author   : chaos

FileName : ptr_str.cpp

Date     : 08/08/17 15:10:50

*/
#include <iostream>
using namespace std;

int main(void)
{
    char str1[] = "Hello";
    char *str2 = "Hello";

    cout << "element \t| ASCII" << endl;
    cout << "---------------------------" << endl;

    for (int i = 0; i < 6; i++) {
        cout << "str1[" << i << "]\t|" << str1[i] << endl;

    }
    cout << endl << "str2:" << reinterpret_cast<void*>(str2) << endl << endl;
    cout << str2 << endl;


    cout << "element \t| ASCII" << endl;
    cout << "---------------------------" << endl;

    for (int i = 0; i < 6; i++) {
        cout << "str2+" << i << "\t|" << *str2 << endl;
        str2++;
    }

    cout << "str2:" << reinterpret_cast<void*>(str2) << endl;
    return 0;
}
